const UA = window.navigator.userAgent;
const isWPTApp = UA.match(/wptmessenger/i);
const isWPTIos = UA.match(/iphone|ipad|ipod/i) && UA.match(/wptmessenger/i);
const isWPTAndroid = UA.match(/android/i) && UA.match(/wptmessenger/i);

const getUuid = () => Math.random().toString(36).substr(2);

const logError = (err) => {
    console.error(`wptBridge: ${err}`);
    // WPT.reportError({
    //     type: 'wpt-bridge-error',
    //     err: `wptBridge: ${err}`,
    // });
};

export { getUuid, isWPTApp, isWPTIos, isWPTAndroid, logError };
